package com.ibm.risk.irmp.workflow.client.flowable.api;

import com.ibm.risk.irmp.workflow.client.flowable.ApiClient;

import com.ibm.risk.irmp.workflow.client.flowable.model.DataResponseUserResponse;
import java.io.File;
import com.ibm.risk.irmp.workflow.client.flowable.model.UserInfoRequest;
import com.ibm.risk.irmp.workflow.client.flowable.model.UserInfoResponse;
import com.ibm.risk.irmp.workflow.client.flowable.model.UserRequest;
import com.ibm.risk.irmp.workflow.client.flowable.model.UserResponse;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.util.UriComponentsBuilder;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;


@Component("com.ibm.risk.irmp.flowable.api.UsersApi")
public class UsersApi {
    private ApiClient apiClient;

    public UsersApi() {
        this(new ApiClient());
    }

    @Autowired
    public UsersApi(ApiClient apiClient) {
        this.apiClient = apiClient;
    }

    public ApiClient getApiClient() {
        return apiClient;
    }

    public void setApiClient(ApiClient apiClient) {
        this.apiClient = apiClient;
    }

    /**
     * Create a user
     *
     * <p><b>200</b> - successful operation
     * <p><b>201</b> - Indicates the user was created.
     * <p><b>400</b> - Indicates the id of the user was missing.
     * @param body The body parameter
     * @return UserResponse
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public UserResponse createUser(UserRequest body) throws RestClientException {
        Object postBody = body;

        String path = UriComponentsBuilder.fromPath("/identity/users").build().toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = {
            "application/json"
        };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<UserResponse> returnType = new ParameterizedTypeReference<UserResponse>() {};
        return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Create a new user’s info entry
     *
     * <p><b>200</b> - successful operation
     * <p><b>201</b> - Indicates the user was found and the info has been created.
     * <p><b>400</b> - Indicates the key or value was missing from the request body. Status description contains additional information about the error.
     * <p><b>404</b> - Indicates the requested user was not found.
     * <p><b>409</b> - Indicates there is already an info-entry with the given key for the user, update the resource instance (PUT).
     * @param userId The userId parameter
     * @param body The body parameter
     * @return UserInfoResponse
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public UserInfoResponse createUserInfo(String userId, UserInfoRequest body) throws RestClientException {
        Object postBody = body;

        // verify the required parameter 'userId' is set
        if (userId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'userId' when calling createUserInfo");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("userId", userId);
        String path = UriComponentsBuilder.fromPath("/identity/users/{userId}/info").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = {
            "application/json"
        };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<UserInfoResponse> returnType = new ParameterizedTypeReference<UserInfoResponse>() {};
        return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Delete a user
     *
     * <p><b>204</b> - Indicates the user was found and  has been deleted. Response-body is intentionally empty.
     * <p><b>404</b> - Indicates the requested user was not found.
     * @param userId The userId parameter
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public void deleteUser(String userId) throws RestClientException {
        Object postBody = null;

        // verify the required parameter 'userId' is set
        if (userId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'userId' when calling deleteUser");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("userId", userId);
        String path = UriComponentsBuilder.fromPath("/identity/users/{userId}").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = { };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
        apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Delete a user’s info
     *
     * <p><b>204</b> - Indicates the user was found and the info for the given key has been deleted. Response body is left empty intentionally.
     * <p><b>404</b> - Indicates the requested user was not found or the user does not have info for the given key. Status description contains additional information about the error.
     * @param userId The userId parameter
     * @param key The key parameter
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public void deleteUserInfo(String userId, String key) throws RestClientException {
        Object postBody = null;

        // verify the required parameter 'userId' is set
        if (userId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'userId' when calling deleteUserInfo");
        }

        // verify the required parameter 'key' is set
        if (key == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'key' when calling deleteUserInfo");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("userId", userId);
        uriVariables.put("key", key);
        String path = UriComponentsBuilder.fromPath("/identity/users/{userId}/info/{key}").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = { };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
        apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Get a single user
     *
     * <p><b>200</b> - Indicates the user exists and is returned.
     * <p><b>404</b> - Indicates the requested user does not exist.
     * @param userId The userId parameter
     * @return UserResponse
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public UserResponse getUser(String userId) throws RestClientException {
        Object postBody = null;

        // verify the required parameter 'userId' is set
        if (userId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'userId' when calling getUser");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("userId", userId);
        String path = UriComponentsBuilder.fromPath("/identity/users/{userId}").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = {
            "application/json"
        };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<UserResponse> returnType = new ParameterizedTypeReference<UserResponse>() {};
        return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Get a user’s info
     *
     * <p><b>200</b> - Indicates the user was found and the user has info for the given key.
     * <p><b>404</b> - Indicates the requested user was not found or the user does ot have info for the given key. Status description contains additional information about the error.
     * @param userId The userId parameter
     * @param key The key parameter
     * @return UserInfoResponse
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public UserInfoResponse getUserInfo(String userId, String key) throws RestClientException {
        Object postBody = null;

        // verify the required parameter 'userId' is set
        if (userId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'userId' when calling getUserInfo");
        }

        // verify the required parameter 'key' is set
        if (key == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'key' when calling getUserInfo");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("userId", userId);
        uriVariables.put("key", key);
        String path = UriComponentsBuilder.fromPath("/identity/users/{userId}/info/{key}").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = {
            "application/json"
        };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<UserInfoResponse> returnType = new ParameterizedTypeReference<UserInfoResponse>() {};
        return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Get a user’s picture
     * The response body contains the raw picture data, representing the user’s picture. The Content-type of the response corresponds to the mimeType that was set when creating the picture.
     * <p><b>200</b> - Indicates the user was found and has a picture, which is returned in the body.
     * <p><b>404</b> - Indicates the requested user was not found or the user does not have a profile picture. Status-description contains additional information about the error.
     * @param userId The userId parameter
     * @return List&lt;byte[]&gt;
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public List<byte[]> getUserPicture(String userId) throws RestClientException {
        Object postBody = null;

        // verify the required parameter 'userId' is set
        if (userId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'userId' when calling getUserPicture");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("userId", userId);
        String path = UriComponentsBuilder.fromPath("/identity/users/{userId}/picture").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = { };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<List<byte[]>> returnType = new ParameterizedTypeReference<List<byte[]>>() {};
        return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * List user’s info
     *
     * <p><b>200</b> - Indicates the user was found and list of info (key and url) is returned.
     * <p><b>404</b> - Indicates the requested user was not found.
     * @param userId The userId parameter
     * @return List&lt;UserInfoResponse&gt;
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public List<UserInfoResponse> listUserInfo(String userId) throws RestClientException {
        Object postBody = null;

        // verify the required parameter 'userId' is set
        if (userId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'userId' when calling listUserInfo");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("userId", userId);
        String path = UriComponentsBuilder.fromPath("/identity/users/{userId}/info").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = {
            "application/json"
        };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<List<UserInfoResponse>> returnType = new ParameterizedTypeReference<List<UserInfoResponse>>() {};
        return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * List users
     *
     * <p><b>200</b> - Indicates the group exists and is returned.
     * @param id Only return group with the given id
     * @param firstName Only return users with the given firstname
     * @param lastName Only return users with the given lastname
     * @param displayName Only return users with the given displayName
     * @param email Only return users with the given email
     * @param firstNameLike Only return userswith a firstname like the given value. Use % as wildcard-character.
     * @param lastNameLike Only return users with a lastname like the given value. Use % as wildcard-character.
     * @param displayNameLike Only return users with a displayName like the given value. Use % as wildcard-character.
     * @param emailLike Only return users with an email like the given value. Use % as wildcard-character.
     * @param memberOfGroup Only return users which are a member of the given group.
     * @param tenantId Only return users which are a members of the given tenant.
     * @param potentialStarter Only return users  which members are potential starters for a process-definition with the given id.
     * @param sort Property to sort on, to be used together with the order.
     * @return DataResponseUserResponse
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public DataResponseUserResponse listUsers(String id, String firstName, String lastName, String displayName, String email, String firstNameLike, String lastNameLike, String displayNameLike, String emailLike, String memberOfGroup, String tenantId, String potentialStarter, String sort) throws RestClientException {
        Object postBody = null;

        String path = UriComponentsBuilder.fromPath("/identity/users").build().toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "id", id));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "firstName", firstName));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "lastName", lastName));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "displayName", displayName));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "email", email));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "firstNameLike", firstNameLike));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "lastNameLike", lastNameLike));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "displayNameLike", displayNameLike));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "emailLike", emailLike));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "memberOfGroup", memberOfGroup));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "tenantId", tenantId));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "potentialStarter", potentialStarter));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "sort", sort));

        final String[] accepts = {
            "application/json"
        };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<DataResponseUserResponse> returnType = new ParameterizedTypeReference<DataResponseUserResponse>() {};
        return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Update a user
     * All request values are optional. For example, you can only include the firstName attribute in the request body JSON-object, only updating the firstName of the user, leaving all other fields unaffected. When an attribute is explicitly included and is set to null, the user-value will be updated to null. Example: {\&quot;firstName\&quot; : null} will clear the firstName of the user).
     * <p><b>200</b> - Indicates the user was updated.
     * <p><b>404</b> - Indicates the requested user was not found.
     * <p><b>409</b> - Indicates the requested user was updated simultaneously.
     * @param userId The userId parameter
     * @param body The body parameter
     * @return UserResponse
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public UserResponse updateUser(String userId, UserRequest body) throws RestClientException {
        Object postBody = body;

        // verify the required parameter 'userId' is set
        if (userId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'userId' when calling updateUser");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("userId", userId);
        String path = UriComponentsBuilder.fromPath("/identity/users/{userId}").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = {
            "application/json"
        };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<UserResponse> returnType = new ParameterizedTypeReference<UserResponse>() {};
        return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Update a user’s info
     *
     * <p><b>200</b> - Indicates the user was found and the info has been updated.
     * <p><b>400</b> - Indicates the value was missing from the request body.
     * <p><b>404</b> - Indicates the requested user was not found or the user does not have info for the given key. Status description contains additional information about the error.
     * @param userId The userId parameter
     * @param key The key parameter
     * @param body The body parameter
     * @return UserInfoResponse
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public UserInfoResponse updateUserInfo(String userId, String key, UserInfoRequest body) throws RestClientException {
        Object postBody = body;

        // verify the required parameter 'userId' is set
        if (userId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'userId' when calling updateUserInfo");
        }

        // verify the required parameter 'key' is set
        if (key == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'key' when calling updateUserInfo");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("userId", userId);
        uriVariables.put("key", key);
        String path = UriComponentsBuilder.fromPath("/identity/users/{userId}/info/{key}").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = {
            "application/json"
        };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<UserInfoResponse> returnType = new ParameterizedTypeReference<UserInfoResponse>() {};
        return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Updating a user’s picture
     * The request should be of type multipart/form-data. There should be a single file-part included with the binary value of the picture. On top of that, the following additional form-fields can be present:  mimeType: Optional mime-type for the uploaded picture. If omitted, the default of image/jpeg is used as a mime-type for the picture.
     * <p><b>204</b> - Indicates the user was found and the picture has been updated. The response-body is left empty intentionally.
     * <p><b>404</b> - Indicates the requested user was not found.
     * @param userId The userId parameter
     * @param file Picture to update
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public void updateUserPicture(String userId, File file) throws RestClientException {
        Object postBody = null;

        // verify the required parameter 'userId' is set
        if (userId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'userId' when calling updateUserPicture");
        }

        // verify the required parameter 'file' is set
        if (file == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'file' when calling updateUserPicture");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("userId", userId);
        String path = UriComponentsBuilder.fromPath("/identity/users/{userId}/picture").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        if (file != null)
            formParams.add("file", new FileSystemResource(file));

        final String[] accepts = { };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = {
            "multipart/form-data"
        };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
        apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
}
